const Router = require('koa-router');
const router = new Router();

const statusLogic = require('../business-logic/status');

router.get('/status', async(ctx, next) => {
    let status = await statusLogic.query();
    ctx.send({
        code: 200,
        data: status
    })
})

router.put('/status', async(ctx, next) => {
    let body = ctx.request.body;
    await statusLogic.update(body);
    ctx.send({
        code: 200,
        msg: 'status update success'
    });
})


module.exports = router;